// 导入request.js请求工具
import request from '@/utils/request.js'
// 套餐管理相关接口

// 获取套餐page的接口
export const getSetmealPageApi = (params) => {
    return request.get('/setmeal/page', {
        params
    })
}

// 修改套餐的接口
export const editSetmealApi = (params) => {
    return request.put('/setmeal', params);
}

// 删除套餐的接口
export const deleteSetmealApi = (i) => {
    return request.delete('/setmeal', {
        params: {
            ids: i
        }
    });
}

// 添加套餐的接口
export const addSetmealApi = (params) => {
    return request.post('/setmeal', params);
}


// 查询详情
export const querySetmealByIdApi = (id) => {
    return request.get(`/setmeal/${id}`)
}

// 获取套餐分类列表
export const getCategoryListApi = (params) => {
    return request.get('/category/list', {
        params
    })
}

// 查套餐列表的接口
export const querySetmealListApi = (params) => {
    return request.get('/setmeal/list', {
        params
    })
}

// 文件down预览
export const commonDownloadApi = (params) => {
    return request.get('/common/download', { params }, { headers: { 'Content-Type': 'multipart/form-data' } })
}

// 起售停售---批量起售停售接口
export const setmealStatusByStatusApi = (params) => {
    return request.post(`/setmeal/status/${params.status}`,null,{
        params: { ids: params.id }
    })
}
